﻿@using Microsoft.AspNetCore.Identity;
@model List<IdentityRole>
@{
    ViewData["Title"] = "角色管理";
}

<h2>角色管理</h2>
<a asp-action="Create" class="btn btn-primary">添加角色</a>
<table class="table table-hover">
    <thead>
        <tr>
            <th>ID</th>
            <th>角色名称</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var role in Model)
        { 
            <tr>
                <td>@role.Id</td>
                <td>@role.Name</td>
                <td>
                    <a href ="/role/Edit/@role.Id" class="btn btn-info">编辑</a>
                    <a onclick="return confirm('确认需要删除吗？')" class="btn btn-danger"  href="/role/delete/@role.Id">删除</a>
                </td>
            </tr>
        }
    </tbody>
</table>
